package com.zyx.flinkdemo.stream.window.join;

import com.zyx.flinkdemo.pojo.ClickBean;
import com.zyx.flinkdemo.pojo.Trade;
import com.zyx.flinkdemo.stream.utils.TimeUtils;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Yaxi.Zhang
 * @since 2021/6/30 14:46
 */
public class PrepareData {
    public static List<ClickBean> getClicksData() throws ParseException {
        List<ClickBean> clickList = new ArrayList<>();
        clickList.add(new ClickBean(1, "张三", "./intsmaze", TimeUtils.stringToTime("2019-07-28 12:00:00")));
        clickList.add(new ClickBean(2, "李四", "./flink", TimeUtils.stringToTime("2019-07-28 12:05:05")));
        clickList.add(new ClickBean(3, "张三", "./stream", TimeUtils.stringToTime("2019-07-28 12:45:08")));
        clickList.add(new ClickBean(4, "李四", "./intsmaze", TimeUtils.stringToTime("2019-07-28 13:01:00")));
        clickList.add(new ClickBean(5, "王五", "./flink", TimeUtils.stringToTime("2019-07-28 13:04:00")));
        return clickList;
    }


    public static List<Trade> getTradeData() throws ParseException {
        List<Trade> tradeList = new ArrayList<>();
        tradeList.add(new Trade("张三", 38, "安卓手机", TimeUtils.stringToTime("2019-07-28 12:20:00")));
        tradeList.add(new Trade("王五", 45, "苹果手机", TimeUtils.stringToTime("2019-07-28 12:30:00")));
        tradeList.add(new Trade("张三", 18, "台式机", TimeUtils.stringToTime("2019-07-28 13:20:00")));
        tradeList.add(new Trade("王五", 23, "笔记本", TimeUtils.stringToTime("2019-07-28 13:58:00")));
        return tradeList;
    }
}
